﻿
@using Telerik.Web.Mvc.UI;
@using Nop.Services.Catalog;

@{    
    var _manufacturerService = EngineContext.Current.Resolve<IManufacturerService>();
    var allManufacturers = _manufacturerService.GetAllManufacturers(showHidden: true);


    var manufacturerList = new List<SelectListItem>();
    foreach (var m in allManufacturers)
    {
        var name = m.Name;
        if (name != null)
        {
            //Telerik has an issue when quotes are used. That'why we manually remove all quotes
            //Find more info here: http://www.nopcommerce.com/boards/t/11413/tabs-can-not-be-selected-in-admin-edit-products.aspx
            //TODO remove this code once it's fixed by Telerik team
            name = name.Replace("\"", "");
        }
        var item = new SelectListItem()
        {
            Text = name,
            Value = m.Id.ToString()
        };
        manufacturerList.Add(item);
    }
    
}

@Html.Telerik().DropDownList().Name("Manufacturer").BindTo(manufacturerList)